#!/usr/bin/expect -f
set user  [lindex $argv 0]
set ip  [lindex $argv 1]
set pwd  [lindex $argv 2]
set path  [lindex $argv 3]
#spawn ssh $user@$ip cat /etc/exports | grep $path
spawn ssh $user@$ip showmount -e | grep $path

expect "*password:" {send "$pwd\r"}
interact
